<%--
  Created by IntelliJ IDEA.
  User: Jovi
  Date: 2018/4/10
  Time: 下午2:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<script type="text/javascript">

    function page_nav(frm, num) {
        frm.pageIndex.value = num;
        frm.submit();
    }

    function jump_to(frm, pageno) {
        var regexp = /^\d+$/;
        if (!regexp.test(pageno)) {
            alert("请输入正确的数字！");
            return false;
        } else {
            page_nav(frm, pageno);
        }

    }

</script>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div class="page-bar">
    <ul class="page-num-ul clearfix">
        <li>共${param.totalCount}条记录&nbsp;&nbsp; ${param.pageIndex}/${param.totalPage}页</li>
        <c:if test="${param.pageIndex>1}">
            <a href="javaScript:page_nav(document.forms[0],1)">首页</a>
            <a href="javaScript:page_nav(document.forms[0],${param.pageIndex-1})">上一页</a>
        </c:if>
        <c:if test="${param.pageIndex<param.totalPage}">
            <a href="javaScript:page_nav(document.forms[0],${param.pageIndex+1})">下一页</a>
            <a href="javaScript:page_nav(document.forms[0],${param.totalPage})">最后一页</a>
        </c:if>
        &nbsp;&nbsp;
    </ul>
    <span class="page-go-form"><label>跳转至</label>
    <input type="text" name="inputPage" id="inputPage" class="page-key"/>页
    <button type="button" class="page-btn"
            onClick='jump_to(document.forms[0],document.getElementById("inputPage").value)'>GO</button>
    </span>
</div>
</body>
</html>
